<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
    <title>Chatty Powered By QMass</title>
</h:head>
<h:body>
    <p:breadCrumb>
        <p:menuitem value="Chatty" url="http://localhost:8080/fastdog/web/chatty.xhtml"/>
    </p:breadCrumb>
    <p:outputPanel id="mainpnl">
        <p:panel id="namepnl" rendered="#{chatty.user.name eq null}">
            <h:form>
                <h:outputText value="Your Name ?"/>
                <p:inputText id="name" value="#{chatty.user.name}"/>
                <p:commandButton value="Submit" update="mainpnl"/>
            </h:form>
        </p:panel>
        <p:panel id="chatpnl" rendered="#{chatty.user.name ne null}">
            <p:inputTextarea id="board" readonly="true" value="#{chatBoard.value}"
                             style="width:300px;height:100px;"
                             effectDuration="400"/>
            <h:form>
                <h:outputText value="Type :"/>
                <p:inputText id="type" value="#{chatty.value}"/>
                <p:commandButton value="Submit" update="type" action="#{chatty.post}"/>
                <p:poll interval="1" update="board,servicespnl"/>
            </h:form>
        </p:panel>
    </p:outputPanel>
</h:body>
</html>